import {_decorator, Component, JsonAsset,Node} from 'cc';
// import { 瞒天乐游_曙影_必杀技 } from '../../script/framework/entity/bo/skill/瞒天乐游_曙影_必杀技';
import { BattleAgent } from '../../script/framework/fight/IEffectContainer';
import {logUtil} from '../../script/framework/util/logUtil';
import { ResourceUtil } from '../../script/framework/util/ResourceUtil';
import {player} from "./fight/player";
import {enemy} from "./fight/enemy";
import {zhuoshao} from "../../script/framework/fight/effect/zhuoshao";
import { ActorActionManager } from '../../script/framework/manager/ActorActionManager';

const {ccclass, property} = _decorator;

@ccclass('junitTs')
export class junitTs extends Component {
    //region demo
    egMin() {
        console.log(`${1}`)
    }

    egMax() {
        //region 1.模拟数据
        console.log('--------------------Start--------------------')
        //endregion

        //region 2.数据处理
        console.log('--------------------Deal--------------------')
        //endregion

        //region 3.数据展示
        console.log('--------------------Done--------------------')
        //endregion
    }

    //endregion

    //region 测试区
    //单步测试
    onLoad() {

    }

    start() {
        // this.zhuoshao_egMin()
    }

    //循环测试
    update(deltaTime: number) {
        // this.egMin_伤害飘字()
    }

    //endregion

    //region 测试代码区
    灼烧
    @property(Node)
    灼烧对象: Node | null = null;
    zhuoshao_egMin() {
        /*this.灼烧=new zhuoshao({})
        this.灼烧.duration=5*1000
        this.灼烧.damPerS=25
        this.灼烧.apply(this.灼烧对象.getComponent(ActorActionManager))*/
    }
    stop灼烧(){
        this.灼烧.remove(null)
    }


    count=0
    每秒定时器schedule测试_egMin_失败() {
        this.schedule(() => {
            this.callback()
        }, 3, 3, 0);
    }
    callback() {
        this.count++
        console.log('每秒执行',this.count)
    }
    stopSpawning() {
        // 使用 unschedule 方法和之前保存的 id 来终止定时执行
        console.log('点击事件');
        this.unschedule(this.callback());
    }

    二维动画控制_egMin() {
        /*let animationComponent = this.node.parent.getChildByPath("动画/torch").getComponent(Animation);
        animationComponent.play('idle');*/
    }

    logUtil_egMin() {
        //输出1
        // console.log(`${1}`)

        //输出2
        // console.log("onLoad")

        //输出3
        /*log.log1("onLoad",
            "onLoad",
            log.LOG_LEVEL.LOG,
            "onLoad")*/

        let a='你妈妈的温'
        let log = logUtil.instance
        log.log("less",`${a}`)
        log.log("Coin",`${a}+1`)
    }

    // async 瞒天乐游_曙影_必杀技_egMax() {
    //     //region 1.模拟数据
    //     console.log('--------------------Start--------------------')
    //     //技能数据映射
    //     /*瞒天乐游_曙影_必杀技{
    //         技能数据:
    //             cd.ts
    //         target{
    //             energy
    //             hp
    //             atk
    //         }
    //     }*/
    //     let skillJson: any = await ResourceUtil.loadResType("data/skill", JsonAsset);
    //     let skillList: any = skillJson.json.RECORDS
    //     let 测试技能 = new 瞒天乐游_曙影_必杀技(skillList[0])
    //
    //     let caster:player={
    //         attackPower: undefined,
    //         atk: 100, energy: 200,
    //         hp: 0,
    //         id: 0,
    //         isStarRingActive: undefined,
    //         lastUltimateUsedTime: undefined,
    //         starRingDuration: undefined,
    //         starRingEnergy: undefined
    //
    //     }
    //     let target:enemy= {
    //         atk: 100, energy: 200, hp: 50, id: 0, mp: 80
    //     }
    //     //endregion
    //
    //     //region 2.数据处理
    //     console.log('--------------------Deal--------------------')
    //     //使用技能
    //     if(测试技能.canCast()){
    //         测试技能.cast(caster, target)
    //     }
    //
    //     //技能中释放大招
    //     if(测试技能.yingshi){
    //         测试技能.yingshi.remove(null)
    //     }
    //     //endregion
    //
    //     //region 3.数据展示
    //     console.log('--------------------Done--------------------')
    //     //endregion
    // }


    //endregion

}


